package com.mskj.zxmy.mapper;

import com.github.pagehelper.PageInfo;
import com.mskj.zxmy.dto.ReportQueryDTO;
import com.mskj.zxmy.entity.ReportMain;
import com.mskj.zxmy.entity.SctechMissions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface ReportMapper {
    /**
     * 筛选报工单
     * @param query
     * @return
     */
    List<ReportMain> selectReportList(ReportQueryDTO query);

//    查询报工单列表

    List<ReportMain> getReportList(@Param("query") ReportQueryDTO query);

//    根据Id查询报工单详情
    @Select("select * from  checklistSc05 where id =#{id}")
    ReportMain selectReportById(Integer id);


    @Select("select * from checklistSc05 where wellCallTheFactoryStreamer = #{reportNumber}")
    List<ReportMain> selectReportListByReportNumber(String reportNumber);

    @Select("select missionStream from missionInformationSc02 where  id = #{associatedProductionTasks}")
    String getAssociatedProductionTasks(String associatedProductionTasks);

    @Select("select craftFlowNumber, processName from sctechMissions where id = #{linkProcessTasks}")
    SctechMissions getLinkProcessTasks(String linkProcessTasks);


    List<ReportMain> selectReportListByProductInformation(List<String> productIds);

    List<ReportMain> selectReportListWithFilter(ReportQueryDTO query);

    @Select("select distinct materialCategory from gy02ProductRepository where materialCategory is not null and materialCategory != ''")
    List<String> getCategoryList();

    @Select("select distinct brand from gy02ProductRepository where brand is not null and brand != ''")
    List<String> getBrandList();
}